﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Site.master" AutoEventWireup="true"
    CodeFile="Track.aspx.cs" Inherits="Pages_Dashboard_Account_Track" %>

<%@ Register Src="~/Controls/Reports/TrackStats.ascx" TagPrefix="uc" TagName="Tracks" %>
<%@ Register Src="~/Controls/General/SideMenus/AccountSideMenu.ascx" TagPrefix="uc"
    TagName="AccountSideMenu" %>
<asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" runat="Server">

    <script type="text/javascript">
        $(document).ready(
                            function () 
                            {
                                $('.TextBox')
                                            .attr('value', '')
                                            .focus(
                                                    function () 
                                                    {
                                                        $('.TrackButton').removeClass('DisabledIcon');
                                                    }
                                                  )
                                            .blur(
                                                    function () 
                                                    {
                                                        $('.TrackButton').addClass('DisabledIcon');
                                                    }
                                                );
                            }
                        );


        function Remove(btn, track) {
            $(btn).closest('.post').hide();

            $.ajax(
			  {
			      data: "{trackID:" + track + "}",
			      type: "Post",
			      url: "/Service/WebsiteService.asmx/RemoveTrack",
			      success: null,
			      error: function () { alert('Please try again'); },
			      dataType: "json",
			      contentType: "application/json; charset=utf-8"
			  });
	}

    </script>

</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="Server">
    <div class="track">
        <asp:UpdatePanel runat="server">
            <ContentTemplate>
                <h2>
                    Add a Trace</h2>
                <br />
                <hr />
                <p>
                   In order to track a Twitter account fill in the Twitter username and click the Twitter icon.
				   <br />
				   To track a Facebook account fill in the unique name of the page (shown in the page's URL) and clikc the Facebook icon.
                </p>
                <div class="addTrack">
                    <label class="lFloat">
                        Facebook Page Unique Name
                        <br />
                        OR Twitter Username@</label>
                    <div class="PostBorder TextBoxBorder TracedName">
                        <ui:TextBox runat="server" ID="tbTracedName" CssClass="TextBox" TextMode="SingleLine"
                            Rows="1" Columns="18" ToolTip="Text" BorderWidth="0" AutoResize="false"></ui:TextBox>
                    </div>
                    <asp:Button runat="server" ID="btnFacebook" CssClass="ConnectIcon Icon FacebookIconBig TrackButton DisabledIcon"
                        OnClick="tbnFb_Click" ToolTip="Trace others on Facebook"  ></asp:Button>
                    <asp:Button runat="server" ID="btnTwitter" CssClass="ConnectIcon Icon TwitterIconBig TrackButton DisabledIcon"
                        OnClick="btnTwitter_Click" ToolTip="Trace others on Twitter" ></asp:Button>
                    <div class="clear">
                    </div>
                </div>
                <hr />
                <div class="postedItems">
                    <asp:Repeater runat="server" ID="repTracks">
                        <ItemTemplate>
                            <uc:Tracks runat="server" Track='<%#Container.DataItem %>' />
                        </ItemTemplate>
                    </asp:Repeater>
                </div>
            </ContentTemplate>
        </asp:UpdatePanel>
    </div>
</asp:Content>
<asp:Content ID="Content3" runat="server" ContentPlaceHolderID="LeftMainColContent">
    <uc:AccountSideMenu ID="ucAccountSideMenu" runat="server" />
</asp:Content>
